Golang - 條件式與迴圈



if-else

if condition {
    ...
} else {
    ...
}

switch

switch condition {
case c1:
    ...
case c2:
    ...
default:
    ...
}

for

for i := 0; i < count; i++ {
    ...
}

while

for {
    ...
}
#golang #GO







你可能感興趣的文章

Next.js 入門:使用 next export 輸出 static file

Next.js 入門:使用 next export 輸出 static file

JSDC 2020 開發者年會參與心得分享

JSDC 2020 開發者年會參與心得分享

Code Runner 亂碼問題

Code Runner 亂碼問題






留言討論